﻿

using System.Web.UI;
using System.Web.UI.WebControls;

namespace iOak.Web.BaseModuleControls
{

    /// <summary>
    /// 弹出消息用户控件
    /// </summary>
    public partial class Alert : UserControl
    {
        #region 显示消息
        /// <summary>
        /// 显示消息
        /// </summary>
        public void Show()
        {
            modalPopupExtenderAlert.Show();
        }
        #endregion

        #region 显示消息
        /// <summary>
        /// 显示消息
        /// </summary>
        /// <param name="message">显示消息内容</param>
        public void Show(string message)
        {
            PopupText = message;
            modalPopupExtenderAlert.Show();      
        }
        #endregion

        #region 隐藏消息
        /// <summary>
        /// 隐藏消息
        /// </summary>
        public void Hide()
        {
            modalPopupExtenderAlert.Hide();
        }
        #endregion

        #region 显示的文本


        /// <summary>
        /// 显示的文本

        /// </summary>
        public string PopupText
        {
            set
            {
                labelMessageText.Text = value;
            }
            get 
            {
                return labelMessageText.Text;
            }
        }
        #endregion

        #region 获取消息标签
        /// <summary>
        /// 获取消息标签
        /// </summary>
        public Label MessageLabel
        {
            get
            {
                return labelMessageText;
            }
        }

        #endregion

        #region 按钮显示文本
        /// <summary>
        /// 按钮显示文本
        /// </summary>
        public string YesText
        {
            get
            {
                return buttonYes.Text;
            }
            set
            {
                buttonYes.Text = value;
            }
        }
        #endregion

        #region 设定控件ID
        /// <summary>
        /// 设定控件ID
        /// </summary>
        public string TargetControlId
        {
            set
            {
                modalPopupExtenderAlert.TargetControlID = value;
            }
            get
            {
                return modalPopupExtenderAlert.TargetControlID;
            }
        }
        #endregion
    }
}